package work.timejay.shop.service.shop.impl;

import cn.hutool.core.bean.BeanUtil;
import work.timejay.shop.entity.shop.ShopType;
import work.timejay.shop.mapper.shop.ShopTypeMapper;

import work.timejay.common.SuperServiceImpl;
import org.springframework.stereotype.Service;
import work.timejay.shop.service.shop.ShopTypeService;
import work.timejay.vo.shop.ShopTypeItemVO;

import java.util.List;

/**
 * <p>
 * 项目类型表 服务实现类
 * </p>
 *
 * @author 王文杰
 * @since 2024-02-05
 */
@Service
public class ShopTypeServiceImpl extends SuperServiceImpl<ShopTypeMapper, ShopType> implements ShopTypeService {

    @Override
    public List<ShopTypeItemVO> shopTypeList() {
        List<ShopType> shopTypes = lambdaQuery()
                .eq(ShopType::getStatus, 1)
                .orderByDesc(ShopType::getCreateTime)
                .list();
        return BeanUtil.copyToList(shopTypes,ShopTypeItemVO.class);
    }
}
